P&ID Sheets
P&ID uses the drawing sheets defined in the project environment ([library or project] > Document Production > Drawing Sheets) to define the layout of plotted reports.
There are special sheets for P&I diagrams. Setting up the P&ID sheets includes the following.
Contents of PI_CATALOG
Specify what kind of header information is needed for diagrams. This includes the items you want to plot into the title box.
Set up the database structure with the table editor according to the specification.
Startup scripts
When designers create a new diagram as described in New, they select the type of sheet to use. If they choose the Startup Script option, the script initializes specific settings for the new diagram. Common settings defined in the script include:
- Defining the sheet size.
- Loading decorations, such as border lines, onto the sheet.
- Setting up grid attributes and cut parameters.
- Defining the title box label and its initial contents.
- Loading existing systems, pipelines, and instrument tags from the database into the diagram.
All the tasks listed above could be set up within the startup script, but usually, the startup script calls script sheets to apply 2D decorations to the sheet.
Example Script
In the example code below the typical items to configure are shown with bold text.
#include include/dg.h #include include/pd.h #include include/dmutil.h main() { SetupDrwSheet("CREATE"); return(0); } SetupDrwSheet(string func) { w = 420.; h = 296.; /* load 2D decoration style */ PD_CALL_SCRIPT(setup/sheets.mac, DecorateSheet, Cadmatic, w, h); if(func == "CREATE"){ /* ** Set default Drawing attributes */ SET_INT_DEFAULT(ObjDrwAttr, ArLayer,1); SET_INT_DEFAULT(ObjDrwAttr, ArColor,1); SET_INT_DEFAULT(ObjDrwAttr, ArWidth,1); SET_INT_DEFAULT(ObjDrwAttr, EqLayer,1); SET_INT_DEFAULT(ObjDrwAttr, EqColor,2); SET_INT_DEFAULT(ObjDrwAttr, EqWidth,1); SET_INT_DEFAULT(ObjDrwAttr, InstruLayer,1); SET_INT_DEFAULT(ObjDrwAttr, InstruColor,3); SET_INT_DEFAULT(ObjDrwAttr, InstruWidth,1); SET_INT_DEFAULT(ObjDrwAttr, PirunLayer,1); SET_INT_DEFAULT(ObjDrwAttr, PirunColor,6); SET_INT_DEFAULT(ObjDrwAttr, PirunWidth,1); /* load necessary objects needed already at the start */ PD_CALL_SCRIPT("",READ_SYSTEMS_FROM_DATABASE); PD_CALL_SCRIPT("",READ_PIPELINES_FROM_DATABASE); PD_CALL_SCRIPT("",READ_TAGS_FROM_DATABASE); } return(0); }
Title box 2D symbol
Make the 2D symbol to be used as a text type label to plot the title box and its associated data from PI_CATALOG. See Title Box Symbol.
Title box label
Edit the 'labels' script and configure the RETRIEVE_TITLEBOX_DATA script function to retrieve data from PI_CATALOG. See 'labels' script.